package main

import (
	"crypto/tls"
	"fmt"
	"io/ioutil"
	http "net/http"
	"os"
)

func main() {
	fmt.Println("hello world")
	rootURL := "https://www.baidu.com"
	tlsConfig := &tls.Config{
		InsecureSkipVerify: true,
	}
	transport := &http.Transport{
		TLSClientConfig: tlsConfig,
	}
	client := &http.Client{
		Transport: transport,
	}
	response, err := client.Get(rootURL)
	checkErr(err)

	body, _ := ioutil.ReadAll(response.Body)
	defer response.Body.Close()
	fmt.Println(string(body), err)
}

func checkErr(err error) {
	if err != nil {
		fmt.Println(err)
		os.Exit(1)
	}
}
